package com.bingbing.back.controller;


import com.bingbing.back.dto.CityLocDto;
import com.bingbing.back.service.CityLocService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/city")
public class CityLocController {
    @Resource
    private CityLocService cityLocService;

    /**
     * 搜索所有省份和对应的城市
     * @return CityLocDto中含有citys的list数组：当前省份下的城市
     */
    @RequestMapping("/findAll")
    public List<CityLocDto> findAll(){
        return cityLocService.findAll();
    }
}
